package concurrent;

import java.util.concurrent.CountDownLatch;

public class CountDownLatchTest1 {
    public static void main(String[] args) throws InterruptedException {
        CountDownLatch c = new CountDownLatch(1);
        Runnable a = () -> {
            System.out.println("a开始");
            try {
                c.await();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("a结束");
        };
        new Thread(a).start();
        c.countDown();
        System.out.println("main结束");

    }
}
